/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: 1.c
> Author: wyf
> Website:www.lv1.org
> Created Time: 2024年08月05日 星期一 11时07分42秒
***************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>

int main(int argc, const char* argv[])
{
	int fd = 0;
	char buf[10] = {0};
	int ret = 0;
	char ch = 't';
	fd = open("./pipe",O_WRONLY);
	if(fd == -1)
	{
		perror("open");
		exit(-1);
	}
	int fp =0;
	fp = open("./1.txt",O_RDWR);
	//写
	fp = read(fp,buf,sizeof(buf));
	ret = write(fd,buf,strlen(buf));
	ret = write(fd,&ch,sizeof(ch));
	if(ret == -1)
	{
		perror("write");
		exit(-1);
	}

	

	close(fd);
    return 0;
}
